package com.gnerv.battle.boot.framework.core.config;

import com.gnerv.battle.boot.framework.core.interceptor.AsyncInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Gnerv LiGen
 */
@Configuration
public class GlobalAsyncInterceptorConfig implements WebMvcConfigurer {

    @Resource
    private AsyncInterceptor battleAsyncInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(battleAsyncInterceptor)
                .addPathPatterns("/**");
    }

}